<template>
	<view class="personal-info">
		<view class="bgx">
			<image class="bgi" src="../static/image/background.jpg" mode=""></image>
		</view>
		<view class="top">
			<view class="personal-img-box">
				<image class="personal-img" src="../static/image/portrait.png" mode=""></image>
			</view>
			<view v-if="pages=='user'" :style="style4" class="change" @click="change">
				<text v-show="changeContent==='关注'" class="iconfont iconjiahao"></text> {{changeContent}}
			</view>
			<view v-else class="change" @click="changeInfo">
				编辑资料
			</view>
		</view>
		<view class="name-box">
			<view class="name">
				张三
			</view>
			<view class="douyin-id">
				抖音号:11454q4
			</view>
		</view>
		<view class="text-box">
			<view class="introduce">
				我爱睡觉
			</view>
			<view class="label-box">
				<view class="label">
					清华大学
				</view>
				<view class="label">
					北京
				</view>
			</view>
		</view>
		<view class="number-box">
			<view class="box">
				<text class="number">123</text><text class="text">获赞</text>
			</view>
			<view class="box">
				<text class="number">12</text><text class="text">关注</text>
			</view>
			<view class="box">
				<text class="number">6</text><text class="text">粉丝</text>
			</view>
		</view>
		<view class="add">
			<view class="iconfont iconicon_huabanfuben add-icon">
				<text class="text-icon">添加随拍</text>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		props: ['pages'],
		data() {
			return {
				style4: 'background:red',
				changeContent: "关注"
			};

		},
		created() {
			console.log(this.pages)
		},
		methods: {
			changeInfo() {
				uni.navigateTo({
					url: '/pages/changeInfo/changeInfo'
				})
			},
			change() {
				this.style4 = this.style4 === '' ? "background:red" : ''
				this.changeContent = this.changeContent === '关注' ? "取消关注" : '关注'
			}
		}
	}
</script>

<style lang="scss">
	.personal-info {
		color: #ffffff;
		width: 100%;
		background-color: #000000;

		.bgx {
			width: 100%;
			height: 150px;
			padding: 0 1px;
			z-index: -1;

			.bgi {
				width: 100%;
				height: 100%;
			}
		}

		.top {
			width: 100%;
			background-color: #000000;
			height: 70px;
			z-index: 20;
			position: relative;

			.personal-img-box {
				position: absolute;
				top: -25px;
				left: 30px;

				.personal-img {
					width: 80px;
					height: 80px;
					border-radius: 50%;
					border: 3px solid #000000;
				}
			}

			.change {
				position: absolute;
				top: 15px;
				right: 75px;
				z-index: 20;
				width: 40%;
				height: 30px;
				line-height: 30px;
				font-size: 16px;
				text-align: center;
				background-color: #333333;
				border-radius: 5px;
			}
		}

		.name-box {
			padding: 0 25px;
			color: #eeeeee;
			z-index: 25;

			.name {
				height: 50px;
				line-height: 50px;
				font-size: 26px;
			}

			.douyinId {
				height: 25px;
				line-height: 25px;
				font-size: 14px;
			}
		}

		.text-box {
			padding: 0 25px;
			margin-top: 8px;
			border-top: 1px solid #222222;

			.introduce {
				height: 30px;
				line-height: 30px;
				font-size: 15px;
				color: #eeeeee;
			}

			.label-box {
				width: 100%;
				height: 25px;
				line-height: 25px;
				color: #eeeeee;

				.label {
					height: 20px;
					padding: 0 5px;
					line-height: 20px;
					font-size: 12.5px;
					background-color: #333333;
					color: #999999;
					float: left;
					border-radius: 1.5px;
					margin-right: 10px;
				}
			}

		}

		.number-box {
			width: 100%;
			padding: 0 25px;
			height: 35px;

			.box {
				float: left;
				margin-right: 15px;
				font-size: 15px;
				height: 35px;
				line-height: 35px;

				.number {
					color: #ffffff;
					font-weight: 500;
				}

				.text {
					color: #cccccc;
					font-size: 14px;
				}
			}
		}

		.add {
			width: 100%;
			height: 30px;
			margin-top: 5px;
			box-sizing: border-box;
			padding: 0 25px;

			.add-icon {
				width: 100%;
				height: 35px;
				line-height: 35px;
				border-radius: 3px;
				text-align: center;
				background-color: #222222;
				font-size: 16px;

				.text-icon {
					margin-left: 2px;
					font-size: 14px;
				}
			}
		}

		.option-box {
			width: 100%;
			height: 50px;
			line-height: 50px;
			margin-bottom: 10px;

			.option {
				width: 33%;
				color: #999999;
				float: left;
				text-align: center;
			}
		}
	}
</style>
